package com.shark.lib.rebirth;

import android.content.Context;

public interface IRebirthProcess {
    /**
     * Initialization some files or other when 1st time
     */
    boolean onInit(Context context, RebirthEnvConfigs configs);

    /**
     * when Persistent processName create
     */
    void onPersistentCreate(Context context, RebirthEnvConfigs configs);

    /**
     * when DaemonAssistant processName create
     */
    void onDaemonAssistantCreate(Context context, RebirthEnvConfigs configs);

    /**
     * when watches the processName dead which it watched
     */
    void onDaemonDead();


    void setOnDaemonDeadListener(OnDaemonDeadListener listener);

    interface OnDaemonDeadListener{
       void onDaemonMaybeDead();
    }


//    class Fetcher {
//
//        private static volatile IRebirthProcess mDaemonStrategy;
//
//        /**
//         * fetch the strategy for this device
//         *
//         * @return the daemon strategy for this device
//         */
//        static IRebirthProcess fetchStrategy() {
//            if (mDaemonStrategy != null) {
//                return mDaemonStrategy;
//            }
//            mDaemonStrategy = new RebirthProcessImpl();
//            return mDaemonStrategy;
//        }
//    }
}
